<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var str = 'hello world';
        // console.log(str.charAt(0));
        // console.log(str.charAt(1));
        for (var i = 0; i < str.length; i++) {
            console.log(str.charAt(i));
            // console.log(str.charCodeAt(i));//返回ASCII码值
            // console.log(str[i]);
        }
    </script>
</head>

<body>

</body>

</html>